import { POST, GET} from "@/utils/index";
import type {IAddAdmin} from "@/mytype/index"
/* 管理员登录 */
interface ILoginData {
    adminname: string,
    password: string
}
 /* 管理员系统登陆 */
export const loginCheckApi = (data: ILoginData) => POST("/admin/login", data);


/* 管理员列表 */
export const getAdminListApi = () => GET("/admin/list");

/* 管理员信息 */
export const getAdminInfoApi = (adminname:string)=> GET ("admin/detail",{adminname})

/* 添加管理员 */

export const addAdminApi = (data: IAddAdmin)=>POST("/admin/add",data)

/* 删除管理员 */
interface IRemoveAdmin {
    adminid: string
}
export const removeAdminApi = (data: IRemoveAdmin) => POST("/admin/delete",data)


/* 修改管理员 */
interface IEditAdmin {
    adminname: string,
    password: string,
    role: string,
    checkedKeys: string
}
export const editAdminApi = (data:IEditAdmin) => POST("/admin/update", data)


/*  */